/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.apertum.diasled.temp;

/**
 *
 * @author Evgeniy Egorov
 */
 import java.awt.Frame;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
import javax.media.opengl.awt.GLCanvas;
import ru.apertum.diasled.common.Uses;
import ru.apertum.diasled.cfg.MyPoint;
 
 public class JavaDia implements Runnable {
     static Thread displayT = new Thread(new JavaDia());
     static boolean bQuit = false;
 
     public static void main(String[] args) {
         double d = Uses.distancePointToSegment(new MyPoint(0, 10), new MyPoint(10, 0), new MyPoint(100, 0));
         System.out.println("d="+d);
         //displayT.start();
     }
 
     public void run() {
         Frame frame = new Frame("Jogl 3D Shape/Rotation");
         GLCanvas canvas = new GLCanvas();
         canvas.addGLEventListener(new JavaRenderer());
         frame.add(canvas);
         frame.setSize(1024, 768);
       //  frame.setUndecorated(true);
         int size = frame.getExtendedState();
         size |= Frame.MAXIMIZED_BOTH;
         //frame.setExtendedState(size);
 
         frame.addWindowListener(new WindowAdapter() {
             public void windowClosing(WindowEvent e) {
                 bQuit = true;
             }
         });
         frame.setVisible(true);
 //      frame.show();
         canvas.requestFocus();
         while( !bQuit ) {
             canvas.display();
         }
     }
 }
